package com.lightboat.system.domain;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import com.lightboat.common.annotation.Excel;
import com.lightboat.common.core.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 评论对象 crm_comment
 * 
 * @author lightboat
 * @date 2025-08-21
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(title = "评论")
@TableName(value = "crm_comment", autoResultMap = true)
public class CrmComment extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 评论ID
     */
    @Schema(title = "评论ID")
    @TableId(type = IdType.INPUT)
    private Long commentId;

    /** 订单ID */
    @Schema(title = "订单ID")
    @Excel(name = "订单ID")
    private Long orderId;

    /** 外部订单ID */
    @Schema(title = "外部订单ID")
    @Excel(name = "外部订单ID")
    private String externalOrderId;

    /** 商品ID */
    @Schema(title = "商品ID")
    @Excel(name = "商品ID")
    private Long productId;

    /** 外部商品ID */
    @Schema(title = "外部商品ID")
    @Excel(name = "外部商品ID")
    private String externalProductId;

    /** 客户ID */
    @Schema(title = "客户ID")
    private Long customerId;

    /** 评分（1-5星） */
    @Schema(title = "评分（1-5星）")
    @Excel(name = "评分", readConverterExp = "1=-5星")
    private Integer score;

    /** 标签集合 */
    @Schema(title = "标签集合")
    @Excel(name = "标签集合")
    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private List<String> tags;

    /** 图片集合 */
    @Schema(title = "图片集合")
    @Excel(name = "图片集合")
    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private List<String> picture;

    /** 评论内容 */
    @Schema(title = "评论内容")
    @Excel(name = "评论内容")
    private String content;

    /** 申诉状态（0:未申诉 1:已申诉） */
    @Schema(title = "申诉状态（0:未申诉 1:已申诉）")
    @Excel(name = "申诉状态", readConverterExp = "0=:未申诉,1=:已申诉")
    private Integer appealStatus;

    /** 用户昵称 */
    @Schema(title = "用户昵称")
    @Excel(name = "用户昵称")
    private String nickName;

    /** 商品信息（JSON格式存储） */
    @Schema(title = "商品信息（JSON格式存储）")
    @Excel(name = "商品信息", readConverterExp = "J=SON格式存储")
    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private JSONObject skuInfo;

    /** 是否精选评论（0:否 1:是） */
    @Schema(title = "是否精选评论（0:否 1:是）")
    @Excel(name = "是否精选评论", readConverterExp = "0=:否,1=:是")
    private Integer selected;

    /** 客户信息 */
    @TableField(exist = false)
    @Schema(title = "客户信息")
    private CrmCustomer customer;
}
